package com.atguigu.lease.web.admin.controller.attr;

import com.atguigu.lease.common.result.Result;
import com.atguigu.lease.model.entity.AttrValue;
import com.atguigu.lease.web.admin.service.AttrValueService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/attr/value")
@Tag(name = "房间属性值管理模块")
public class AttrValueController {
    @Resource
    AttrValueService attrValueService;
    @Operation(summary = "新增/更新房间属性值")
    @PostMapping("/saveOrUpdate")
    public Result saveOrUpdate(@RequestBody AttrValue attrValue){

        return Result.build(attrValueService.saveOrUpdateAttrValue(attrValue));
    }

    @Operation(summary = "删除房间属性值")
    @DeleteMapping("/deleteById")
    public Result deleteById(@RequestParam Long id){
        return Result.build(attrValueService.removeById(id));
    }

}
